package cn.edu.zafu.bigdata.cccnnn;
import java.util.Scanner;

public class  GuessTheNumber{
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int b, n;
        System.out.print("请输入两个整数（猜测的数和尝试次数）: ");
        b = scanner.nextInt(); // 猜测的数
        n = scanner.nextInt(); // 尝试次数

        int a = 0; // 用户输入的数
        int c = 0; // 尝试次数

        while (true) {
            c++;
            System.out.print("请输入一个整数: ");
            a = scanner.nextInt();

            if (c > n || (a < 0 && c <= n)) {
                System.out.println("Game Over");
                break;
            }

            if (a < b) {
                System.out.println("Too small");
            } else if (a > b) {
                System.out.println("Too big");
            } else if (a == b) {
                if (c <= 3 && c > 1) {
                    System.out.println("Lucky You!");
                } else if (c == 1) {
                    System.out.println("Bingo!");
                } else if (c > 3) {
                    System.out.println("Good Guess!");
                }
                break;
            }
        }

        scanner.close();
    }
}

